<?php
class Zend_View_Helper_Navigate {
	public $view;
	protected $_html;
	public function navigate(array $elements, $append = null) {
		$this->prepend(	'<div class="title">
						<ul class="top-nav">
							<li class="first">
								<div class="box">
								<div class="sub">
									<a href="/">Главная</a>
								</div>
								</div>
								<div class="bg-right"> </div>
							</li>'  
		);
		for($i=0;$i<count($elements)-1;$i++){
			$this->_html.='<li>
			<div class="box">
				<div class="sub">
					<strong>
					<a href="' . $elements[$i]['href'] . '">'
						 . $elements[$i]['text'] . 
					'</a>
					</strong>
				</div>
			</div>
			<div class="bg-right"> </div>
		</li>';
		}
		
		$this->append(
		'<li class="last">
			<div class="box">
				<div class="sub">
					<strong>
					<a href="' . $elements[count($elements)-1]['href'] . '">'
						 . $elements[count($elements)-1]['text'] . 
					'</a>
					</strong>
				</div>
			</div>
			<div class="bg-right"> </div>
		</li>
		</ul>');
		if($append)
		{
			$this->append($append);
		}
		$this->append(
		'</div>');
		

	return $this->_html;
	}
	
	public function append($html)
	{
		$this->_html =   $this->_html . $html;
	}
	
	public function prepend($html)
	{
		$this->_html =  $html . $this->_html ;
	}
	
	public function setView(Zend_View_Interface $view) {
		$this->view = $view;
	}
}
